import request from '../utils/request'

export const queryList = (params) => {
  return request({
    method: 'GET',
    url: 'idm-app/rest/admin/groups',
    params: params
  })
}

export const createOne = (data) => {
  return request({
    method: 'POST',
    url: 'idm-app/rest/admin/groups',
    data: data
  })
}

export const modifyOne = (id, data) => {
  return request({
    method: 'PUT',
    url: `idm-app/rest/admin/groups/${id}`,
    data: data
  })
}

export const deleteOne = (data) => {
  return request({
    method: 'DELETE',
    url: `idm-app/rest/admin/groups/${data.id}`
  })
}

// workflow 中查询用户组接口
export const queryWorkFlowGroups = (params) => {
  return request({
    method: 'GET',
    url: 'app/rest/workflow-groups',
    params: params
  })
}

// modeler 中查询用户组接口
export const queryModelerGroups = (params) => {
  return request({
    method: 'GET',
    url: 'modeler-app/rest/editor-groups',
    params: params
  })
}